UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2GbBuMvPwqzs67RwFXVo4d8hjP3nlyL9i2tipYXaCiM=' 
WHERE 
  key_id = '82d09fc9265a80e837252ea6666f92d98f0a56fe8e40c4989741234201de5b47' 
  AND (
    token = '2GbBuMvPwqzs67RwFXVo4d8hjP3nlyL9i2tipYXaCiM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035