UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'woAwAn/kcjqIoaZKgx8HIl3QYRyICBpINP7RWcsCojQ='
WHERE
key_id = '1bdc972437b9c21f793b64c26369890e6c43e7893d9974e5d0256352e0b1f8c1'
AND (
token = 'woAwAn/kcjqIoaZKgx8HIl3QYRyICBpINP7RWcsCojQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)