UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j9g4BB48x+nOGxUI/0bQJLCyxfgmXlLIg2BCMULGiC0=' 
WHERE 
  key_id = '7c3327c7a37cbb9c66023755218d9c9665905808a96cb32d8051c47b54db6afa' 
  AND (
    token = 'j9g4BB48x+nOGxUI/0bQJLCyxfgmXlLIg2BCMULGiC0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046