UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kJ5dw/QKPiDDKiANjU1o/6b6oadblJouqgH4OJ2qlVw=' 
WHERE 
  key_id = 'cb846c5195747c74ac1cb0ec080e18a4867837fdb486aa0c1e4efb18c2ced96e' 
  AND (
    token = 'kJ5dw/QKPiDDKiANjU1o/6b6oadblJouqgH4OJ2qlVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028