UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yVciF+x8VMAbrLpiGofOZLKS1WwM2LfMdu6cjXyWvDM=' 
WHERE 
  key_id = 'ec1ee0dbe7b63aaa885c106db325e9713ab38b971643ffba70937f5659064430' 
  AND (
    token = 'yVciF+x8VMAbrLpiGofOZLKS1WwM2LfMdu6cjXyWvDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036