UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4D7XYAiC/8C78lkN7dFtcWazdCgLFA7xdfMi03DHdCM='
WHERE
key_id = '08632f02dee310d69d98cd6dc8c13f5c9a16c82d820b40d0e1880736946e34db'
AND (
token = '4D7XYAiC/8C78lkN7dFtcWazdCgLFA7xdfMi03DHdCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)