UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uVVl4BKFFHtlNCZhXuZtQvZyzo3FutQKfE0WfKGoXgo='
WHERE
key_id = '0838bd1dbab7e9b16f76ff478c86a80fcefb3aa806ede2d5fa6efe9acf18a18b'
AND (
token = 'uVVl4BKFFHtlNCZhXuZtQvZyzo3FutQKfE0WfKGoXgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)