UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iDXv5PxhHmTqqcIgerL5GuINrd/4XpKZgHVmkldM4YI='
WHERE
key_id = '66af5609a15302dd124b69c58f025ad363313a4fbb6cb26961efcc218c0f417c'
AND (
token = 'iDXv5PxhHmTqqcIgerL5GuINrd/4XpKZgHVmkldM4YI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)