UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7BlqCzVr2LZfWFoihTgR2Nc/H3Z9YqznJ1PzRpBVtnM='
WHERE
key_id = '10c7b86965a36fcfd369664a775f2eddfa258e8c3d2617b4f02f06e83e246f99'
AND (
token = '7BlqCzVr2LZfWFoihTgR2Nc/H3Z9YqznJ1PzRpBVtnM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)