UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wvY0JEdJ/62NTLfGRsM6WQNoIBEP8FhwLzKCUjq1aOk=' 
WHERE 
  key_id = 'cbaac1ccbfd61e436c441986cba50c786135b7bc0898f93f5bf2cb0d88cc5a85' 
  AND (
    token = 'wvY0JEdJ/62NTLfGRsM6WQNoIBEP8FhwLzKCUjq1aOk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015