UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W+lt+3oPBPC8ZMYdWm7SAegS19+94BNdLuDxGKW+I7E='
WHERE
key_id = 'd89242826be2d157bc224027938ffb64a8805d15babeccf59fa36dc466ad518a'
AND (
token = 'W+lt+3oPBPC8ZMYdWm7SAegS19+94BNdLuDxGKW+I7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)