UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HuxOfrNTOwg/RKKpxWaRLZ/p/fG3QMKDhL5cQjfdct0=' 
WHERE 
  key_id = '134a8fb5ce6c539b85ca6b950c2f8fba110e9867ca3ea6f814372b5c177f42e2' 
  AND (
    token = 'HuxOfrNTOwg/RKKpxWaRLZ/p/fG3QMKDhL5cQjfdct0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014