UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RaSkHbtSfHN0iYto8YgFGm/o99DDJeKFHg8bI5ORt84=' 
WHERE 
  key_id = '64e55468e3b1270167fe4460f5cee9a9c28cbc723c3c666dd4c7d3df2754e8aa' 
  AND (
    token = 'RaSkHbtSfHN0iYto8YgFGm/o99DDJeKFHg8bI5ORt84=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013