UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '99ZMWiTsij7gJ/TxmcMkjRtm6kp3JArFgH/R+Qlb+8U=' 
WHERE 
  key_id = '61ee706c7bb65ac10c10d153ab95dc937a4e2e39519a95496256d4711cef00d6' 
  AND (
    token = '99ZMWiTsij7gJ/TxmcMkjRtm6kp3JArFgH/R+Qlb+8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032