UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd4kGTsBkApxTlNytdMwUxUvcxyqEftjf3Pn/VkW1Xm4='
WHERE
key_id = '3fce7698bc12e8df2cefc058805b35162cef35b43b9cdc7f60952ffcbc05f402'
AND (
token = 'd4kGTsBkApxTlNytdMwUxUvcxyqEftjf3Pn/VkW1Xm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)