UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1z2eBMeAg7gTtSfLVpXP9WkZFVyzbE//AoQcv/ZhAcc='
WHERE
key_id = 'd01400ecc36507b4a140eab18d965259821053c9e62affd500c0f8c6f22be7f1'
AND (
token = '1z2eBMeAg7gTtSfLVpXP9WkZFVyzbE//AoQcv/ZhAcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)