UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'edd/YucUenWr5dBQZCCzljLOY0fP/lHhrrzXA2XUBaY=' 
WHERE 
  key_id = 'c1974089c9658545bed96a45fc2743a80bfdf2e4caeed30ed4245a87d93783ff' 
  AND (
    token = 'edd/YucUenWr5dBQZCCzljLOY0fP/lHhrrzXA2XUBaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025