UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2VLHLE6Hi2B9rnEzFu9Id9ieOAeu77sOtbHAw/K3Xvw=' 
WHERE 
  key_id = '6573b85cca5c2b7f8ae39f4ef41b7b5d5e7aedad5de09add2b59d445f922ee5f' 
  AND (
    token = '2VLHLE6Hi2B9rnEzFu9Id9ieOAeu77sOtbHAw/K3Xvw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032