UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KG5Rgg1C+pmL92XNv94CCHPkdDvXR4Sue2c8//5YoIo='
WHERE
key_id = '46129a023bfd7e3e7c7822676d10a0e67bd2513dafb4b329748a8ac3c7ff7cb4'
AND (
token = 'KG5Rgg1C+pmL92XNv94CCHPkdDvXR4Sue2c8//5YoIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)