UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GzyXHjlaZ7xxxhGwvg4hK/2dRbZw2WPTfl4rQa0CvbU=' 
WHERE 
  key_id = '0e3fca95cbccebc78fd3dda77dbab255749328abb42d0fa9e253d1386a33e14d' 
  AND (
    token = 'GzyXHjlaZ7xxxhGwvg4hK/2dRbZw2WPTfl4rQa0CvbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035