UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DrF6PNdsq2K6rkJ0X/FR7Th0XzENHXYM3pEQJg5CumE='
WHERE
key_id = '1c616d80240b9ab139657bfad5dc030691e09c641018ba74d06e6208b3dd433d'
AND (
token = 'DrF6PNdsq2K6rkJ0X/FR7Th0XzENHXYM3pEQJg5CumE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)