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

Query time 0.00036