UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rptwa3+MUc//uD61YAPkpO09NkxdLGidQ4jef1gKGFk='
WHERE
key_id = 'a1b8227bdb937c40b9fa961087009764f2e293eac9f5d97579761ebe04cb993f'
AND (
token = 'Rptwa3+MUc//uD61YAPkpO09NkxdLGidQ4jef1gKGFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)