UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ur3CoNaFp8Q4XPGUjDJ7U20JnKW3+0UpEGc/FBUMvg=' 
WHERE 
  key_id = '973ff508c7a9c1302a933a9cbb5c1eea4f96727ae11e15768ab4159a64b9f448' 
  AND (
    token = '9ur3CoNaFp8Q4XPGUjDJ7U20JnKW3+0UpEGc/FBUMvg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015