UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QAWqA9DbIr7gc9BysKJ3/7OYNbAWqhsj4nvkco/UdQM=' 
WHERE 
  key_id = '7dd0c5e30bac2da66143ab8ce0317e5d442f9eaf4506d3b3f5840605440f1ad1' 
  AND (
    token = 'QAWqA9DbIr7gc9BysKJ3/7OYNbAWqhsj4nvkco/UdQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022