UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uy8A9FExGLaMUViQWzAgwNF2D/uG2ovX/Sa5fWRdOUE=' 
WHERE 
  key_id = 'e2f1c9f5495df8f07c41dad2f1bd236f9d23e13776ecc26ab9f9f7b2a09342bb' 
  AND (
    token = 'uy8A9FExGLaMUViQWzAgwNF2D/uG2ovX/Sa5fWRdOUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026