UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZniItgATiQbh9QyJb520hlIKi/DCswu2t+FtTa56Ik0='
WHERE
key_id = 'ff07b32b5cdd140dc5bcf24f5a1e6506675961641f9527be891eeaac502d0635'
AND (
token = 'ZniItgATiQbh9QyJb520hlIKi/DCswu2t+FtTa56Ik0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)