UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qXtcL3cXYlSlJejnT1DrwPLjUV45Q/S6e1FaFOvvDYc='
WHERE
key_id = '7e3abca9e5dae919b7a196bd4427d4e4d05f6f5ebc64384659c92c0052a1c018'
AND (
token = 'qXtcL3cXYlSlJejnT1DrwPLjUV45Q/S6e1FaFOvvDYc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)