UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CCExZ6YM5ir3Sx8JQ0or52pgkn56EWxt9LL0k9oCu8c=' 
WHERE 
  key_id = '06f5294ed2abb1e8a59a7eac1004a7f7f8915df693d5ceb5bc4b1f4e21d55387' 
  AND (
    token = 'CCExZ6YM5ir3Sx8JQ0or52pgkn56EWxt9LL0k9oCu8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020