UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6i52++YVuodN9mAjT9LC81dhcGT2QXc1+jI4u6Ap+GA='
WHERE
key_id = '2d24032f7cf032fa5ea2ea24ea11aed3f8bda233c15cf7a105861bcd301bbf7c'
AND (
token = '6i52++YVuodN9mAjT9LC81dhcGT2QXc1+jI4u6Ap+GA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)