UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1NKMnsbcaQbJF738Vg0w6Nx2p7XfdxGHgaAzNR7AlHY=' 
WHERE 
  key_id = 'dfa5fc3e1a338817631f6ab23be58afe24548a10282216c110b6351a5c3f9899' 
  AND (
    token = '1NKMnsbcaQbJF738Vg0w6Nx2p7XfdxGHgaAzNR7AlHY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034