UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WhVh4Jy04qGjKciglaF8UZWsio6XPh7dvhwTWHAwu50=' 
WHERE 
  key_id = 'c7a9eff7a9f9bc1178069d91482fab3a71f88be47d20ac05f12ac97c5c3a725f' 
  AND (
    token = 'WhVh4Jy04qGjKciglaF8UZWsio6XPh7dvhwTWHAwu50=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027