UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kDniDdTNPh/PaaQun+g8DuTr3HC7QBQIVfP6jlc1H3U=' 
WHERE 
  key_id = '97e9a7d4641a8d68821dc9e7d12159903830ac453a4687497ca05dfc39ab3e16' 
  AND (
    token = 'kDniDdTNPh/PaaQun+g8DuTr3HC7QBQIVfP6jlc1H3U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040