UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gE1/is0bvmv1aVloGCnf6sOn/VPW4mR+Bmkh0BQFdXM=' 
WHERE 
  key_id = '5868874c67a13b5b7ecf88742503ca8726f0e5adb9d2aabd4db756bba00d465c' 
  AND (
    token = 'gE1/is0bvmv1aVloGCnf6sOn/VPW4mR+Bmkh0BQFdXM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045