UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iGkdmP9J2cJFhu5CZycXvdSOVTCkmp0NnNah96aSyRY=' 
WHERE 
  key_id = 'b895fe1710aea208a9e0d28fbbb0154cabfb51be0bb51448e3583ea36d985c08' 
  AND (
    token = 'iGkdmP9J2cJFhu5CZycXvdSOVTCkmp0NnNah96aSyRY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034