UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VWwn0EqIjItgHEYG1MeX8tFlqHL+brfsGGautpfP87Q=' 
WHERE 
  key_id = 'f71d921fad7b26cba2095d218cf352746e2aa9adbf148b0d58b9fbfd0f93e3da' 
  AND (
    token = 'VWwn0EqIjItgHEYG1MeX8tFlqHL+brfsGGautpfP87Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026