UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jKs//3zhpCnL6aq++q1htGu0IS2thgZSphnsiZWKgiI=' 
WHERE 
  key_id = '364b0fc0c6eaa9a506711a5bc9f005946e5d81436ff018110e2cd1a946c92472' 
  AND (
    token = 'jKs//3zhpCnL6aq++q1htGu0IS2thgZSphnsiZWKgiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016