UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2AwMcvVBP4R/KujfRYmr4+zrddHB/ulgboAgL901Duo='
WHERE
key_id = 'b75e0a9d5dcedbc3a4a835db3c934e967099763e637af445ee048f9949963fe6'
AND (
token = '2AwMcvVBP4R/KujfRYmr4+zrddHB/ulgboAgL901Duo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)