UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dS7Nc+J7Vp2ArFOipN5o8a1Ue7wmoPkxzWA9FHH7hvo=' 
WHERE 
  key_id = '77cd56f30ce1b7ce66392f424a19968dedbd905fea2f4c7fbe74a7528d7514fc' 
  AND (
    token = 'dS7Nc+J7Vp2ArFOipN5o8a1Ue7wmoPkxzWA9FHH7hvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023