UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WO9wDrh8AIVeFzt/L+UYMre9yzWsmeg7ETzUpYFMrlo=' 
WHERE 
  key_id = '46443b51d31dfec7c272c8cee4a21b886adaa5e40d9e31807d18fbde47c9be84' 
  AND (
    token = 'WO9wDrh8AIVeFzt/L+UYMre9yzWsmeg7ETzUpYFMrlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036