UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Ud6z9hXdXhSJOCnP5XoyJa021T/S1k5UGHz7BzG5Zc='
WHERE
key_id = 'aa8e0459b50472b3bc2331a0b8b93f53f0940fe6e614fec4f61dd73bcacf6dcf'
AND (
token = '4Ud6z9hXdXhSJOCnP5XoyJa021T/S1k5UGHz7BzG5Zc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)