UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4pnoXzi3xc9aY6yYdTAYDZCOdIV+Mj1lJPZMBMy7d4c='
WHERE
key_id = '52c00f95996d6a2ef4aa39b46f3c199442be1f6941ed045c70d0b5fefb8f81e0'
AND (
token = '4pnoXzi3xc9aY6yYdTAYDZCOdIV+Mj1lJPZMBMy7d4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)