UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bD0STt6QBxotjBbCemA6SjXBwqnLaQ+X93BCxqyeyXg=' 
WHERE 
  key_id = 'a8655f9382d2cf7ecd026fdae34ae2c894030b73ab6cf32a9ed5a8f7831b984c' 
  AND (
    token = 'bD0STt6QBxotjBbCemA6SjXBwqnLaQ+X93BCxqyeyXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015