UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b2x1poNGyJKM6B++rZfPr3GSk0K1aRfLNukeUGPhSb8='
WHERE
key_id = '3cb8c8bc5bacfd698afd4d420409dc83cf502863b8295e3738ac6fe7a094e7da'
AND (
token = 'b2x1poNGyJKM6B++rZfPr3GSk0K1aRfLNukeUGPhSb8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)