UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Iii2cR624x7q6lqb5UNtlPlwaevlygIpSUbb/kVupIU=' 
WHERE 
  key_id = '711dccf5e65d4e4ca51fc60c27acf0a30b35dbb134f5c38a430405c4ccc070b4' 
  AND (
    token = 'Iii2cR624x7q6lqb5UNtlPlwaevlygIpSUbb/kVupIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033