UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/BorI83eYh/5oSgAHYlDP42PCR89hrHajJcs7pApkDk='
WHERE
key_id = '2ba3f6af31821f315640a16bc6895b8afd47eed5bfdb951526aff6e6a0186bb3'
AND (
token = '/BorI83eYh/5oSgAHYlDP42PCR89hrHajJcs7pApkDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)