UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cN4jO9DnNzThMd2YoitVZlztyXrDNG+eQKZPDqBNDnY='
WHERE
key_id = '0bc780481e2d0fd03d1a6d157a14f8a097ce18ac5ab09ec2f6c87ddedede909f'
AND (
token = 'cN4jO9DnNzThMd2YoitVZlztyXrDNG+eQKZPDqBNDnY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)