UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3BB32hU/djS4WpVyrJ2T4rtVtObzEAoQvGB7a9rjwTA=' 
WHERE 
  key_id = '04c90dad18108ce03e1bbc9c2863e2362696e50ec58c20f33ecc79bfd0f870a3' 
  AND (
    token = '3BB32hU/djS4WpVyrJ2T4rtVtObzEAoQvGB7a9rjwTA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052