UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hEVCXvFbWB7zmKi7XJDoZPBOzLjttE5lGGhxxhcqNCw=' 
WHERE 
  key_id = '6f057d01c45ca0b773ea385c7c0ca5532603dfd6f8b6bd4f37b24ed55689dda7' 
  AND (
    token = 'hEVCXvFbWB7zmKi7XJDoZPBOzLjttE5lGGhxxhcqNCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029