UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8bUOz6ktYjWhuhlWzAzJnZ6Ql9Tzn5r2AgPYXKryyOU=' 
WHERE 
  key_id = '54cd3992081ac972cf3525308bd378d53c179b5efb6e26edfbcf6c0a186efec5' 
  AND (
    token = '8bUOz6ktYjWhuhlWzAzJnZ6Ql9Tzn5r2AgPYXKryyOU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028