UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UMjKLvpm7XVrdKRpNVJlTPqW1+DsAqfuHsN3EC0CKYA=' 
WHERE 
  key_id = '08bfae4a9bd522d70c106b4826bbaea4298cb7e5ba105c2c2320098001ec6b0f' 
  AND (
    token = 'UMjKLvpm7XVrdKRpNVJlTPqW1+DsAqfuHsN3EC0CKYA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022