UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v/djL8vkMcEQ1uyK0GfaXEDmKFAyh/3S850gsvyRkRk='
WHERE
key_id = '95ac9b2abca1f80f715953d7023b08b24c88b8017df900eed2242cf92b5d766f'
AND (
token = 'v/djL8vkMcEQ1uyK0GfaXEDmKFAyh/3S850gsvyRkRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)