UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kA3Wkuir5iBThTW80/hIz3shK/+xKwjE1oXLOCw2zCE='
WHERE
key_id = 'd272dc11830d2156a454a550ca3c04938c91b156d00dced428a10f588655e30a'
AND (
token = 'kA3Wkuir5iBThTW80/hIz3shK/+xKwjE1oXLOCw2zCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)