UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PtqY+rwOxDMMmpA/diO/AHafy+ymMEVtrw8ua5vBwjE='
WHERE
key_id = '5184e9b9cfd779e3b0a8db388421959a116f5b20bf218e160e69f0f49122b3b2'
AND (
token = 'PtqY+rwOxDMMmpA/diO/AHafy+ymMEVtrw8ua5vBwjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)