UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dSUSYoGlNc1mNOWBrEIoXtqqzDh9itz+xMx/xj0YHdU='
WHERE
key_id = 'b185b342ff2b3c0a61221dcce8f36dfba1062f73c41c9ac77fd9e4d1fba18a86'
AND (
token = 'dSUSYoGlNc1mNOWBrEIoXtqqzDh9itz+xMx/xj0YHdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)