UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZnAEJx3bR+LacGiXqKcd8Aq66Mw+SgsEMzcAZZzx2Pk='
WHERE
key_id = '5341b8b5b943d44bcc94282ecbb5751c3b8ec28d6d054eb2872720960d6238ae'
AND (
token = 'ZnAEJx3bR+LacGiXqKcd8Aq66Mw+SgsEMzcAZZzx2Pk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)